﻿using System.Collections.Generic;
using System.Drawing;
using System;
using System.Text;

namespace HOOMT
{
    public class ObjectDiagram: OriginalDiagram
    {
        private  List<Method> methodList = new List<Method>();
        public List<Method> MethodList
        {
            get { return methodList; }
            set { methodList = value; }
        }

        private  List<Attribute> attributeList = new List<Attribute>();
        public List<Attribute> AttributeList
        {
            get { return attributeList; }
            set { attributeList = value; }
        }

        private List<NonFunctionRequirment> objectNFRList = new List<NonFunctionRequirment>();
        public List<NonFunctionRequirment> ObjectNFRList
        {
            get { return objectNFRList; }
            set { objectNFRList = value; }
        }
        
        private string exportControl;
        public string ExportControl
        {
            get { return exportControl; }
            set { exportControl = value; }
        }

        private string stereotype;
        public string Stereotype
        {
            get { return stereotype; }
            set { stereotype = value; }
        }

        private string type;
        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        private string documengtation;
        public string Documengtation
        {
            get { return documengtation; }
            set { documengtation = value; }
        }
        

        public ObjectDiagram(Point point, int width, int height)
            :base(point, width, height)
        {
            exportControl = "Public";
        }

        public override void Drawing(Graphics g, OriginalModelForm m)
        {
            base.Drawing(g, m);
        }

        protected virtual String cutShortString(String str)
        {
            int singleCharLong = 6;
            if (str.Length * singleCharLong > width)
                return str.ToString().Substring(0, width / singleCharLong);
            else
                return str.ToString();
        }

        protected string getNFRListString(List<NonFunctionRequirment> NFRList)
        {
            StringBuilder NFRBuilder = new StringBuilder();
            foreach (NonFunctionRequirment requirment in NFRList)
            {
                NFRBuilder.Append(requirment.ToString());
            }
            return NFRBuilder.ToString();
        }
        
    }
}
